Release 10.1A: OpenEdge Development:
Progress 4GL Reference
INSERT-ATTRIBUTE( ) method
Adds a single attribute to a start tag in an XML document represented by a SAX-writer object.
Return Type: LOGICAL Applies to: SAX-writer object handle
nameA LONGCHAR expression evaluating to the fully qualified or unqualified name of the attribute.
valueA LONGCHAR expression evaluating to the value of the attribute.
namespace-URIA LONGCHAR expression evaluating to the URI of the attribute. If the attribute doesn’t contain a namespace, then set it to an empty string ("") or the Unknown value (
?).Call this method to add a simple, single attribute to a start tag. You can only call this method immediately after a call to the START-ELEMENT, EMPTY-ELEMENT, INSERT-ATTRIBUTE, or DECLARE-NAMESPACE method. That is, you can only call this method when the WRITE-STATUS is SAX-WRITE-TAG. After calling this method, the status remains SAX-WRITE-TAG.
Regardless of the value of the STRICT attribute, this method fails if you do not call it following one of the valid methods listed above.
If you use
namespace-URI, then the method resolves the prefix in the following order:If the method call only contains
nameand that value contains a prefix, then the SAX-writer attempts to resolve the prefix to a namespace. If it fails to resolve the namespace and the STRICT attribute is TRUE, then the method fails.Namespace declarations appear as attributes in an XML document. It is possible to declare a namespace by using INSERT-ATTRIBUTE. To declare a namespace with INSERT-ATTRIBUTE, the special prefix for namespaces,
Examplexmlns, you must use the prefix with the name of the attribute, and the namespace URI must be the value of the attribute.The following code fragment illustrates how to declare a namespace with the INSERT-ATTRIBUTE method:
Namespaces declared using INSERT-ATTRIBUTE in this way are considered namespaces and checked with other namespaces during the write of the XML document. If the
xmlnsprefix does not appear, then attribute is inserted as a regular attribute and it is not handled with the namespace checking during the write.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |